<html>
<head><meta charset="utf-8"><title>static mut unsafe · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/static.20mut.20unsafe.html">static mut unsafe</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="206213347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/static%20mut%20unsafe/near/206213347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/static.20mut.20unsafe.html#206213347">(Aug 07 2020 at 00:30)</a>:</h4>
<p>So I realized I missed static mut in my unsafe PR's. I got the highlight one done pretty easily, but I'm having trouble determining whether a path expr points to a static. Is there any infrastructure setup to determine that? I imagine it would need to be something within infer, since the static mut name could be shadowed, but nothing stands out.</p>



<a name="206214526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/static%20mut%20unsafe/near/206214526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/static.20mut.20unsafe.html#206214526">(Aug 07 2020 at 00:54)</a>:</h4>
<p>Found a way to get the info. I was able to get a resolver for the expr, then call <code>resolve_path_in_value_ns</code> to determine whether it's static or not.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>